package com.kcwl.carrier.application.service;

import com.kcwl.carrier.domain.entity.CarrierMappingInfo;
import com.kcwl.carrier.domain.service.CarrierMappingDomainService;
import com.kcwl.carrier.interfaces.dto.CarrierMappingDTO;
import com.kcwl.carrier.interfaces.query.CarrierMappingQuery;
import com.kcwl.framework.utils.KcBeanConverter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lxp
 * @date 2022/12/30 18:35
 * @Description
 */
@Service
@Slf4j
public class CarrierMappingApplicationService {

    @Autowired
    CarrierMappingDomainService carrierMappingDomainService;

    /**
     * 查询司机,车辆,车主关系
     * @return
     */
    public List<CarrierMappingDTO> queryCarrierMapping(CarrierMappingQuery carrierMappingQuery) {
        List<CarrierMappingInfo> carrierMappingInfoList = carrierMappingDomainService.queryCarrierMappingInfo(carrierMappingQuery);
        return KcBeanConverter.toList(carrierMappingInfoList, CarrierMappingDTO.class);
    }

}
